package com.ty.cust;

import com.android.internal.telephony.TelephonyIntents;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class MainReceiver extends BroadcastReceiver {
	private final Uri URI_TEST = Uri.parse("android_secret_code://11");
	
	@Override
	public void onReceive(Context context, Intent intent) {
		String action = intent.getAction();
		if(Intent.ACTION_BOOT_COMPLETED.equals(action)) {
			android.util.Log.i("checkIMEI","BOOT_COMPLETED");
			Intent intent1 = new Intent(context,MainService.class);
			intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			context.startService(intent1);
		}else if(TelephonyIntents.SECRET_CODE_ACTION.equals(action)) {
			Uri uri = intent.getData();
			if(URI_TEST.equals(uri)) {
				Intent intent1 = new Intent(context,MainActivity.class);
				intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				context.startActivity(intent1);
			}
		}
	}
}